import requests

# 增加  部门
from common.get_header import get_token

i = get_token()

req = requests.post(url="http://ihrm2-test.itheima.net/api/company/department",
                    headers=i,
                    json={"name": "测试", "code": "003"})
print(req.json())

# # 查看  部门
# req = requests.get(url="http://ihrm2-test.itheima.net/api/company/department/1570743306525208576",
#                     headers=i)
# print(req.json())
# # 修改  部门
# req = requests.put(url="http://ihrm2-test.itheima.net/api/company/department/1570743306525208576",
#                     headers=i,
#                     json={"name": "产品部", "code": "002"})
# print(req.json())
#
# # 删除  部门
# req = requests.delete(url="http://ihrm2-test.itheima.net/api/company/department/1570743306525208576",
#                     headers=i)
# print(req.json())